<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
 <style>
    .mouse{
        position: absolute;
        background: #ffd965;
        width: 48px;
        height: 48px;
        border-radius: 24px;
    }
 </style>
<body>
    <div id="div" class="mouse"></div>
</body>
</html>
<script>
    var div=document.getElementById('div');
    document.onclick=function(event){
        var e = event||window.event;
        var pageX=e.pageX||e.clientx+document.documentElement.scrollLeft;
        var pageY=e.pageY||e.clienty+document.documentElement.scrollTop;
        var taegetX=pageX-div.offsetWidth/2;
        var taegetY=pageY-div.offsetHeight/2;
        div.style.display='black';
        div.style.left=taegetX+'px';
        div.style.top=taegetY+'px';
    }
</script>